<!doctype html>
<html>
<head>
<title>Embedding Test</title>
<style>

html, body, * { margin: 0; padding: 0; }

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    background-color: #ebebeb;
    color: #000;
}
h1 {
    font-size: 150%;
    background-color: #802;
    color: #fff;
    padding: 0.3333em 1.3333em;
}
p {
    padding: 1em 2em;
}
#embeddor {
    background-color: #fff;
    padding: 1em;
    margin: 0 auto 2em 2em;
    width: 656px;
}
#embedded {
    width: 656px;
    height: 1000px;
    border: none;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$(function(){
    var m = window.location.search.match(/[&?]p=([^&]*)/);
    var url = window.location.origin + (m ? m[1] : '/');
    $('#embed-url').text(url);
    $('#embedded').attr('src', url);
})
</script>
</head>
<body>
    <h1>Embed Test</h1>
    <p>Embedding: <span id="embed-url"></span></p>
    <div id="embeddor">
    <iframe id="embedded" />
    </div>
</body>
</html>
